<template>
  <basic-container :btnFlag = true>
    <div class="card-body">
      <card-header :header-data="headerData"></card-header>
      <avue-crud :data="consultData"
                 :option="option"
                 :table-loading="tableLoading"
                 @on-load="getConsultList">
        <template slot-scope="scope" slot="menu">
          <div class="menu-title" @click.stop="consult(scope.row,scope.index)">
            <i class="iconfont iconview icon-primary"></i>
            <p class="menu-title-text">会商</p>
          </div>
        </template>
      </avue-crud>
    </div>
  </basic-container>
</template>

<script>
  import {getConsultList} from "@/api/planning/project";
  export default {
    name: "consultList",
    data() {
      return {
        headerData: {
          title: "会商列表"
        },
        consultData: [],
        tableLoading: false,
        option: {
          page: true,
          addBtn: false,
          editBtn: false,
          addRowBtn: false,
          indexLabel: "序号",
          index: true,
          indexWidth:70,
          cellBtn: false,
          delBtn: false,
          columnBtn: false,
          refreshBtn: false,
          filterBtn: false,
          searchBtn: false,
          menuWidth: 100,
          keyId: "id",
          column: [
            {
              label: "发起会商环节",
              prop: "taskName",
              cell: true,
            },
            {
              label: "会商部门名称",
              prop: "deptName",
              width: 240,
              cell: true,
            },
            {
              label: "反馈截止时间",
              prop: "endDate",
              cell: true,
            },
            {
              label: "创建时间",
              prop: "createTime",
              width: 200,
              cell: true,
            },

          ]
        }
      }
    },
    methods: {
      getConsultList() {
        var Obj = {
          businessId: this.$route.params.id,
          type: this.$route.query.type
        };
        getConsultList(Obj).then(response => {
          this.consultData = response.data.data;
        })
      },
      // 去会商跳转
      consult(row,index) {
        let src = `/endDisscussion/detail/${row.taskId}`;
        this.$router.push({
          path: src,
          query: {
            registerinfoId: row.businessId,
            topicId:row.topicId,
            type:this.$route.query.type
          }
        });
      },



    }
  }
</script>

<style scoped>
  .card-body {
    padding: 10px;
    min-height:400px
  }
</style>
